#让我们的电脑支持服务访问
#web框架

#flask pip install flask
from flask import Flask, request,render_template
#随机生成数据
from random import randint
#创建应用
app = Flask(__name__)
#实现应用
hero = [
    "狂战士-奥拉夫","正义巨像-加里奥","黑暗之女-安妮","卡牌大师-崔斯特","德邦总管-赵信","无畏战车-厄加特","猩红收割者-弗拉基米尔","诡术妖姬-乐芙兰",
    "远古恐惧-费德提克","正义天使-凯尔","牛头酋长-阿利斯塔","无极剑圣-易大师","符文法师-瑞兹","亡灵战神-塞恩","战争女神-希维尔","众星之子-索拉卡",
    "迅捷斥候-提莫","麦林炮手-崔丝塔娜","祖安怒兽-沃里克","蛮族之王-泰达米尔","寒冰射手-艾希","赏金猎人-厄运小姐","武器大师-贾克斯","雪原双子-努努",
    "痛苦之拥-伊芙琳","时光守护者-基兰","炼金术士-辛吉德","堕落天使-莫甘娜","瘟疫之源-图奇","死亡颂唱者-卡尔萨斯"
]

@app.route("/index")
def index():
    return render_template("index.html",hero = hero)

@app.route("/choujiang")
def choujiang():
    num = randint(0,len(hero)-1)
    return render_template("index.html", hero=hero, h = hero[num])


app.run(debug=True)